<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>银行卡详情</title>
    <link href="css/bootstrap-4.0.0.css" rel="stylesheet">
    <style>
        .bind-info{
            width: 500px;
            margin: 0 auto;
            text-align: center;
            padding: 20px;
        }
    </style>
</head>
<body>
<div th:insert="fragment/header :: top-header"></div>
<div class="container card-detail">
    <div class="bind-info">
        <div class="img-box">
            <img th:src="${cardInfo.card_img}" alt="">
            <p th:text="${cardInfo.card_name}"></p>
        </div>
        <button type="button" class="btn btn-danger" onclick="closeCard()">注销</button>
    </div>
</div>
<script th:inline="javascript">
    function closeCard(){
        $.ajax({
            url: "/closeAccount",
            type: 'get',
            data:{
                id: [[${bindId}]]
            },
            success: function (res){
                alert("注销成功！");
                location.href = "/";
            },
            error: function (error){
                alert(error);
            }
        })

    }
</script>
</body>
</html>